import React, {useState, createContext} from 'react'
import Bfn from './Bfn';

export const MyContext = createContext()
export default function AFn() {
  const [name, setName] = useState('Timo');
  return (
    <div>
      {/* MyContext.Provider用来提供数据， value是具体的数据 */}
      <MyContext.Provider value={name}>
        <p>父组件</p>
        <Bfn></Bfn>
      </MyContext.Provider>
    </div>
  )
}
